#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	int n = 0;
	char s;
	while ((s = getchar()) != '\n')
	{
		n++;
		if (s == ' ') n--;
	}
	printf("%d\n", n);
	return 0;
}
//5008